import request from "@/api/utils/request.js";

const BASE_PREFIX = "/common";

export default {
  uploadForImage: (prefix, fileData) => {
    const data = new FormData();
    data.append('file', fileData);
    return request({
      headers: {
        'Content-Type': 'multipart/form-data'
      },
      url: `/file/upload/image/${prefix}`,
      method: 'POST',
      data: data
    })
  },

  getVerifyCode: (target, workType) => {
    return request({
      url: `${BASE_PREFIX}/getVerifyCode`,
      method: 'POST',
      data: {
        target: target,
        workType: workType
      }
    })
  },

  checkVerifyCode: (work_type, target, verify_code) => {
    return request({
      url: `${BASE_PREFIX}/checkVerifyCode`,
      method: 'POST',
      data: {
        workType: work_type,
        target: target,
        verifyCode: verify_code
      }
    })
  }
}